package com.joysuch.wwyt.mh.service;

import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.mh.entity.MhMajorHazardPlan;
import com.joysuch.wwyt.mh.bean.MhMajorHazardTaskSearchBean;
import com.joysuch.wwyt.mh.bean.vo.MhMajorHazardTaskVO;
import com.joysuch.wwyt.mh.dto.MhMajorHazardTaskRecordDTO;
import com.joysuch.wwyt.mh.entity.MhMajorHazardTask;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.mh.entity.MhMajorHazardTaskRecord;
import com.joysuch.wwyt.mh.utils.WeekRange;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zqw
 * @since 2022-05-24
 */
public interface MhMajorHazardTaskService extends IService<MhMajorHazardTask> {

    ResultBean pageTask(MhMajorHazardTaskSearchBean searchBean);

    MhMajorHazardTaskVO findById(Long assignId);

    void deleteByAssignId(Long assignId);

    /**
     * 履职
     *
     * @param recordDto
     * @return
     */
    MhMajorHazardTaskRecord finishTask(MhMajorHazardTaskRecordDTO recordDto);


    List<WeekRange> getWeekRangeOnMonth(int year, int month);

    /**
     * 生成任务
     *
     * @param plan  计划实体
     * @param isNew 是否新增
     */
    void produceTaskByPlan(MhMajorHazardPlan plan, boolean isNew);

    /**
     * 修改task状态
     *
     * @param taskId
     */
    void updateTaskStatus(Long taskId);

    /**
     * 删除未做的任务
     *
     * @param planId
     */
    void deleteUnFinishedTask(Long planId);

    /**
     * 定时处理过期任务
     */
    void doOverdueTasksSchedule();
}
